<template>
    <div class="box">
        <div class="header">
            <van-nav-bar title="标题"  left-arrow @click="$router.go(-1)">
                <template #right>
                    <van-icon name="service-o" style="font-size: 20px;" />
                </template>
            </van-nav-bar>
        </div>
        <div class="meddle">
            <div>
                <li v-for="obj in list" :key="obj.id" >
                    <img :src="obj.image" alt="" style="width: 100%;" >
                    <p>{{ obj.title }}</p>
                    <p style="color: red;">￥{{ obj.price }}</p>
                </li>
            </div>


        </div>
    </div>
</template>
<script setup>

import request from '@/utils/request.js'
import { ref, onMounted } from 'vue'

import { useRoute, useRouter } from 'vue-router'

const router = useRouter()
const route = useRoute()
const obj = ref([])
onMounted(() => {
    request.get('/detail', {
        params: {
            id: route.params.id
        }
    }).then(res => {
        if (res.data.code == 200) {
            obj.value = res.data.data
        }
    })
})
</script>